Substance monitoring and control in human or animal bodies

ABSTRACT

Apparatus for monitoring a substance in human or animal in real time, the apparatus comprising a sensor providing a time series of measurements of substance level, said measurements being indicative of an inferred level of said substance in a part of said human or animal and a processor which applies an interacting multiple model strategy to a system model to provide a combined estimate of the inferred substance level from the substance level measurements. The substance may be glucose. The apparatus may also be adapted to control said substance using said interacting multiple model strategy to a system model to provide a combined estimate of a dose to be applied.

This application relates to monitoring and controlling levels of substances, e.g. glucose, in human or animal bodies.

BACKGROUND

Insulin is secreted by the pancreas in a highly controlled fashion to maintain the plasma glucose concentration within a narrow physiological range. In type 1 diabetes, insulin is administered exogenously to mimic the basal and postprandial insulin needs. The standard therapy is based on multiple insulin injections using a combination of short and long acting insulin analogues supported by blood glucose self-monitoring. Treatment by the continuous subcutaneous insulin infusion (CSII), i.e. using insulin pumps, is on the rise.

Continuous glucose monitoring promises to improve glucose control in subjects with diabetes (D. C. Klonoff. Continuous Glucose Monitoring: Roadmap for 21st century diabetes therapy. Diabetes Care 28 (5):1231-1239, 2005). New minimally invasive and non-invasive techniques are being developed; see examples such as U.S. Pat. No. 5,086,229 and U.S. Pat. No. 5,497,772.

Supporting the development of new minimally invasive and non-invasive measurement techniques, a range of mathematical methods has been proposed to aid data processing. Data processing is confounded by measurements of the glucose sensor being normally carried out in a fluid distinct from plasma, such as in the interstitial, dermal, or tear fluid. The kinetics properties of the transfer between plasma and the measurement fluid result in a delay between plasma and the measurement fluid (K. Rebrin, G. M. Steil, W. P. Van Antwerp, and J. J. Mastrototaro. Subcutaneous glucose predicts plasma glucose independent of insulin: implications for continuous monitoring. American Journal of Physiology-Endocrinology and Metabolism 277 (3):E561-E571, 1999). Thus, the ratio between the plasma glucose and the glucose in the measurement fluid changes with time and appropriate techniques are required to calculate an estimate of plasma glucose from sensor measurements apart from filtering out the measurement error.

The extended (linearised) Kalman filter has been proposed as a suitable computational vehicle for data processing of glucose sensor signal, see U.S. Pat. No. 6,575,905, U.S. Pat. No. 6,572,545, WO02/24065 and E. J. Knobbe and B. Buckingham. “The extended Kalman filter for continuous glucose monitoring” (Diabetes Technol. Ther. 7 (1):15-27, 2005). Process noise is an integral component of the Kalman filter. The process noise represents the random disturbance which is not captured by the other model components and is distinct from the measurement error, which describes the random component of the measurement process. The characteristics of the process noise are usually obtained from retrospective analysis of experimental data. However, the characteristics and specifically the variance of the process noise may be subject to temporal variations due to physiological or life-style factors excluded from modelling. For example, following meal ingestion, the process noise will have considerably higher variance compared to that applicable to fasting conditions. The standard Kalman filter is unable to accommodate and correct for such temporal variations because it uses fixed values for the process noise.

There are other known methods for monitoring glucose levels, for example WO97/28787 uses an adaptive mathematic model and U.S. Pat. No. 5,497,772 uses an enzymatic sensor to sense glucose levels.

The advancements in the field of continuous glucose sensors have stimulated the development of closed-loop systems based on combination of a continuous monitor, a control algorithm, and an insulin pump (R. Hovorka. Continuous glucose monitoring and closed-loop systems. Diabet. Med. 23 (1):1-12, 2006). This is denoted as an artificial pancreas. The original concept was introduced in late 70's, see U.S. Pat. No. 4,055,175 and U.S. Pat. No. 4,464,170, for example.

A wide spectrum of control algorithms has been proposed to titrate insulin in a closed-loop fashion, see a review by Parker et al (R. S. Parker, F. J. Doyle, III, and N. A. Peppas. The intravenous route to blood glucose control. IEEE Eng. Med. Biol. Mag. 20 (1):65-73, 2001). Two main categories have been employed, classical feedback control embodied in the proportional-integral-derivative (PID) controller (G. M. Steil, K. Rebrin, C. Darwin, F. Hariri, and M. F. Saad. Feasibility of automating insulin delivery for the treatment of type 1 diabetes. Diabetes 55 (12):3344-3350, 2006), and model predictive control (MPC) (R. Hovorka, V. Canonico, L. J. Chassin, U. Haueter, M. Massi-Benedetti, Federici M. Orsini, T. R. Pieber, H. C. Schaller, L. Schaupp, T. Vering, and M. E. Wilinska. Nonlinear model predictive control of glucose concentration in subjects with type 1 diabetes. Physiol Meas. 25 (4):905-920, 2004).

The Kalman filter was also used as part of control algorithm for closed-loop glucose control (R. S. Parker, F. J. Doyle, III, and N. A. Peppas. A model-based algorithm for blood glucose control in type I diabetic patients. IEEE Trans. Biomed. Eng 46 (2):148-157, 1999). A linearised Kalman filter was also proposed, see U.S. Pat. No. 6,572,545. The Kalman filter or the extended Kalman filter (described above) provide computationally efficient means to track and predict glucose excursions and are used in combination with a physiologically-based glucoregulatory model represented by stochastic differential equations.

There are other known methods for controlling glucose levels, for example, US2003/0208113 describes a system for assisting a person to maintain blood glucose levels between predetermined limits and U.S. Pat. No. 4,055,175 describes glucose control using a model based on quadratic and biquadratic equations.

Statements of Invention

According to the invention there is provided a method of real time substance monitoring in a living human or animal, the method comprising:

-   -   inputting a time series of substance level measurements from a         sensor, said substance level measurements being indicative of a         inferred level of said substance in a part of said human or         animal,     -   calculating a first estimate of said inferred substance level         from said measured substance level using a first system model,     -   calculating a second estimate of said inferred substance level         from said measured substance level using a second system model         with said second system model being a variation of said first         system model and     -   predicting a combined estimate of the inferred substance level         based on a combination of the first and second estimates.

By using multiple models, the method may be considered to use an interacting multiple model strategy, i.e. a strategy in which two or more models may be defined with each model being a variation of the system model. Thus, in other words, according to another aspect of the invention, there is provided a method of real time substance monitoring in a living human or animal, the method comprising: inputting a time series of substance level measurements from a sensor, said substance level measurements being indicative of a inferred level of said substance, defining a system model which estimates said inferred substance level from said measured substance level, and applying an interacting multiple model strategy to the system model to provide a combined estimate of the inferred substance level.

The combined estimate may be a combined estimate of the current inferred substance level or a combined estimate of a future inferred substance level.

Each variation of the model may have a different process noise. As explained previously, the process noise represents the random disturbance which is not captured by the other model components. For each model, an estimate of the inferred substance level and the process noise is calculated in a computationally efficient manner. The estimates for each model are combined to provide a combined estimate of the inferred substance level. When combining the estimates, each estimate is preferably weighted according to an associated mixing probability, i.e. a probability of the estimate representing the true value. In other words, if one model is the most likely, this model is given the highest weighting so that the combined estimate is based primarily on this model. If no one model is the most likely, the weightings may be adjusted accordingly to give a more balanced representation of each model in the overall estimate. Said mixing probability may be updated responsive to a difference between said predicted glucose level measurement of each respective said model and said glucose level measurement from said sensor.

As an alternative to defining the models to have different process noise, the multiple models defined by the interacting multiple model strategy may differ in certain model constants. As described in the prior art, the extended Kalman filter may be used for a model which is non-linear in a certain parameter. However, the extended Kalman filter approximates the solution and for highly non-linear models this may be a problem. Using the interacting multiple model strategy permits the definition of a number of models, each differing in the fixed level of the parameter causing non-linearity. These models run in parallel, with no approximations being necessary (albeit the models are confined to discrete levels of the non-linear parameter) and the most appropriate parameter level may be chosen.

The interacting multiple model (IMM) strategy has been introduced to allow computationally efficient tracking of a maneuvering target (E. Mazor, A. Averbuch, Y. Bar-Shalom, and J. Dayan. Interacting multiple model methods in target tracking: A survey. IEEE Transactions on Aerospace and Electronic Systems 34 (1):103-123, 1998). A maneuvering target is characterised by temporal variability in acceleration, where the acceleration is, in effect, the process noise.

Besides use in radar and GPS tracking, see for example U.S. Pat. No. 5,325,098, U.S. Pat. No. 7,079,991, and U.S. Pat. No. 6,876,925, in the biomedical field the IMM approach has been used to monitor kinetic parameters (D. S. Bayard and R. W. Jelliffe. A Bayesian approach to tracking patients having changing pharmacokinetic parameters. J. Pharmacokinet. Pharmacodyn. 31 (1):75-107, 2004) and the imaging field, see for example (P. Abolmaesumi and M. R. Sirouspour. An interacting multiple model probabilistic data association filter for cavity boundary extraction from ultrasound images. IEEE Trans. Med. Imaging 23 (6):772-784, 2004).

The present applicant has recognised that the IMM is well suited to handle the temporal variations of the process noise of substance monitoring, for example when using a Kalman filter described above.

The substance being monitored is preferably glucose and the model is a glucoregulatory model. For glucose monitoring, the inferred glucose level may be the plasma glucose concentration which is not directly measurable and the measured glucose level may be the interstitial glucose level. The glucose level may be measured intravenously, subcutaneously and/or intradermally.

The glucoregulatory model may comprise five sub-models, the sub-model of insulin absorption, the sub-model of insulin action, the sub-model of gut absorption, the sub-model of glucose kinetics, and the sub-model of interstitial glucose kinetics. Alternatively, the glucoregulatory model may consist of a sub-set of the five models, e.g. the sub-model of glucose kinetics and the sub-model of interstitial glucose kinetics which interact to predict the inferred glucose level, e.g. plasma glucose concentration, from the measured glucose level, e.g. glucose level in the interstitial fluid.

For glucose monitoring, the process noise may represent the change in the unexplained glucose influx. The interacting multiple model strategy may comprise defining for each variation of the model, a state vector comprising a set of variables each having an associated uncertainty. The set of variables may comprise variables representing glucose amounts in the accessible, non-accessible and/or interstitial compartments and a variable representing an unexplained change in glucose level.

Alternatively, the substance being monitored may be the depth of anaesthesia. More information on the control of anaesthesia and the appropriate models which may be used in the interacting multiple model strategy may be determined from EP 1278564 and related application EP 1725278 to Aspect Medical Systems Inc. Other references are D. A. Linkens and M. Mahfouf. “Generalized Predictive Control with Feedforward (Gpcf) for Multivariable Anesthesia.” International Journal Of Control 56 (5):1039-1057, 1992, M. Mahfouf and D. A. Linkens. “Non-linear generalized predictive control (NLGPC) applied to muscle relaxant anaesthesia.” International Journal Of Control 71 (2):239-257, 1998, M. M. Struys, E. P. Mortier, and Smet T. De. “Closed loops in anaesthesia.” Best. Pract. Res. Clin. Anaesthesiol. 20 (1):211-220, 2006 or V Sartori, P Schumacher, T Bouillon, M Luginbuehl and M Morari “On-line estimation of propofol pharmacodynamic parameters.” Annual International Conference of the IEEE Engineering in Medicine and Biology Society (2005), 1 74-7.

The method may comprise applying a Kalman filter. A Kalman filter has two distinct steps; a predict step which uses the state estimate from the previous timestep to produce an estimate of the state at the current timestep and an update step which comprises using measurements at the current timestep to refine the estimate from the predict step to arrive at a new, more accurate, state estimate for the current timestep. In other words, the method may comprise predicting the state estimate from the previous timestep to produce an estimate of the state at the current timestep and updating the estimate using measurements at the current timestep to refine the estimate from the predicting step to arrive at an updated state estimate for the current timestep. The covariance, i.e. a measure of the estimated accuracy of the state estimate, may be used when refining the estimate. The update step may also comprise updating the covariance.

The method may further comprise predicting an estimate for the mixing probability and updating the predicted estimate for the mixing probability based on measurements of the substance levels. The combined estimate preferably uses the updated mixing probability estimates.

The method may further comprise an interact step which links the various models. The interact step may comprise determining the mixing probability from the mode probability, i.e. the probability that the system model transitions from one variation model to another variation model.

According to another aspect of the invention there is a method of real time glucose monitoring in a living human or animal, the method comprising

-   -   inputting a time series of glucose level measurements from a         glucose sensor;     -   constructing at least two state vectors each comprising a set of         variables for a respective one of at least two glucose level         models, said state vectors representing states of said at least         two models, said state vectors also including a variable         representing an uncertainty in a change in glucose level with         time, each of said variables having an associated probability         distribution;     -   predicting a value of a said glucose level using said         probability distribution and said state vectors;     -   updating values of said state vectors responsive to a difference         between a predicted glucose level measurement for each said         model and a glucose level measurement from said sensor; and     -   determining a combined predicted glucose level measurement for         said human or animal by combining outputs from said glucose         level models according to a mixing probability representing a         respective probability of each said model correctly predicting         said glucose level; and     -   further comprising updating said mixing probability responsive         to said predicted glucose level measurement of each respective         said model and said glucose level measurement from said sensor.

The method may further comprise using the value of a first of state vectors to modify a second of said state vectors to thereby represent a transition between said models.

According to another aspect there is provided a method of controlling a substance in a human or animal in real time, the method comprising

-   -   obtaining a combined estimate for the inferred substance level         as previously described,     -   inputting a desired reference value for the inferred substance         level     -   calculating, using said combined estimate, a dose to obtain said         desired reference value and     -   applying said dose to a patient.

According to another aspect there is provided a method for real time control of a substance in a human or animal, the apparatus comprising:

-   -   calculating a combined estimate using real time monitoring as         described above, and     -   calculating a specified amount of medication as the amount of         medication required to bring the combined estimate into line         with a desired value and delivering said specified amount of         medication to a user.

Additionally or alternatively, the calculation of the specified amount and/or does may be calculated using a method similar to that used for monitoring and the combined estimate may be calculated by any other method.

Thus, according to another aspect there is provided a method for real time control of a substance in a human or animal, the method comprising providing a time series of measurements of substance level, said measurements being indicative of an inferred level of said substance in a part of said human or animal, calculating an estimate of said inferred level, calculating a specified amount of medication to be the amount of medication required to bring the estimate of said inferred level in line with a desired value by calculating a first estimate of said specified amount of medication using a first system model, calculate a second estimate of said specified amount of medication using a second system model with said second system model being a variation of said first system model, calculating said specified amount of medication based on a combination of said estimates and delivering said specified amount of medication to a user. The method may further comprise calculating said estimate of said inferred level using real time monitoring as described above.

The substance being controlled may be glucose and the dose/medication applied may be insulin, glucagons or similar substances or a combined thereof. The substance being controlled may be the depth of anaesthesia glucose and the dose/medication applied may be anaesthesia.

According to another aspect of the invention, there is provided a method for controlling glucose in human or animal body, comprising calculating a combined estimate using real time monitoring as described above, and displaying a suggested insulin bolus to be applied on a user interface, wherein the suggested insulin bolus is calculated by the processor as the amount of medication required to bring the combined estimate into line with a desired glucose value. The method may comprise using the interacting multiple model strategy described above to calculate the insulin bolus to be applied.

According to another aspect there is provided apparatus for monitoring a substance in human or animal in real time, the apparatus comprising:

-   -   a sensor providing a time series of measurements of substance         level, said measurements being indicative of an inferred level         of said substance in a part of said human or animal and     -   a processor which is adapted to perform the following steps:     -   calculate a first estimate of said inferred substance level from         said measured substance level using a first system model,     -   calculate a second estimate of said inferred substance level         from said measured substance level using a second system model         with said second system model being a variation of said first         system model and         predicting a combined estimate of the inferred substance level         based on a combination of the first and second estimates.

By using multiple models, the method may be considered to use an interacting multiple model strategy, i.e. a strategy in which two or more models may be defined with each model being a variation of the system model. Thus, in other words, according to another aspect of the invention there is provided apparatus for monitoring a substance in human or animal in real time, the apparatus comprising:

-   -   a sensor providing a time series of measurements of said         substance level, said measurements being indicative of an         inferred level of said substance in a part of said human or         animal and     -   a processor which applies an interacting multiple model strategy         to a system model to provide a combined estimate of the inferred         substance level from the substance level measurements.

The substance being monitored is preferably glucose and the model is a glucoregulatory model. For glucose monitoring, the inferred glucose level may be the plasma glucose concentration which is not directly measurable and the measured glucose level may be the interstitial glucose level. The glucose level may be measured intravenously, subcutaneously and/or intradermally.

Alternatively, the substance being monitored may be the depth of anaesthesia.

The processor may be a state estimator and the interacting multiple model strategy may comprise defining for each variation of the model, a state vector comprising a set of variables each having an associated uncertainty. The set of variables may comprise variables representing glucose amounts in the accessible, non-accessible and/or interstitial compartments and a variable representing an unexplained change in glucose level.

The glucoregulatory model may comprise five sub-models, the sub-model of insulin absorption, the sub-model of insulin action, the sub-model of gut absorption, the sub-model of glucose kinetics, and the sub-model of interstitial glucose kinetics. Alternatively, the glucoregulatory model may consist of a sub-set of the five models, e.g. the sub-model of glucose kinetics and the sub-model of interstitial glucose kinetics.

The apparatus may further comprise a user monitor with an input/output interface to receive inputs from the user, e.g. meals and exercise information and to display the status of the apparatus.

The apparatus may further comprise a real-time alarm which is activated when the combined estimate is below a preset hypoglycaemia threshold or above a preset hyperglycaemia threshold.

According to another aspect there is provided apparatus for monitoring glucose in human or animal in real time, the apparatus comprising:

-   -   (an input or) a continuous glucose sensor providing an estimate         of glucose level     -   an optimal state estimator based on the interacting multiple         model strategy and adopting a stochastic model to provide         optimal estimate of glucose level from data obtained by the         continuous glucose sensor

The interacting multiple model strategy may use a standard or extended Kalman filter.

The apparatus may comprise one or more additional glucose sensors providing independent estimates of glucose level. At least one sensor may measure glucose intravenously. At least one sensor may measure glucose subcutaneously. At least one sensor may measure glucose subcutaneously. At least one sensor may measure glucose intradermally.

The apparatus may further comprise a user monitor with an input/output interface to receive inputs from the user and to display the status of the apparatus.

The apparatus may further comprise a real-time alarm which is activated when the optimal glucose estimate is below a preset hypoglycaemia threshold or above a preset hyperglycaemia threshold.

The apparatus may use the interacting multiple model strategy to make a prediction of future glucose values and/or to indicate sensor failure when the estimate of the process noise exceeds a predefined value.

According to another aspect of the invention, there is provided apparatus for real time control of glucose in a human or animal, the apparatus comprising:

-   -   a glucose sensor providing a time series of measurements of         glucose level, said measurements being indicative of plasma         glucose concentration,     -   a processor which applies an interacting multiple model strategy         to a glucoregulatory model to provide a combined estimate of the         plasma glucose concentration from the measured glucose levels,         and     -   a dispenser for delivering a specified amount of medication to a         user in response to a command from the processor,     -   wherein the specified amount of medication is calculated by the         processor as the amount of medication required to bring the         combined estimate into line with a desired glucose value.

The dispenser may deliver insulin or insulin and glucagon, or insulin and another glucose controlling substance.

According to another aspect of the invention, there is provided apparatus for controlling glucose in human or animal body, comprising

-   -   a glucose sensor providing a time series of measurements of         glucose level, said measurements being indicative of plasma         glucose concentration,     -   a processor which applies an interacting multiple model strategy         to a glucoregulatory model to provide a combined estimate of the         plasma glucose concentration from the measured glucose levels,         and     -   a user interface for displaying a suggested insulin bolus to be         applied     -   wherein the suggested insulin bolus is calculated by the         processor as the amount of medication required to bring the         combined estimate into line with a desired glucose value.

The desired glucose value may vary with time to define a trajectory of desired or set-point values. The trajectory may be input to the processor by a user, e.g. via a user interface which accepts input from a user.

The processor may comprise a model combiner to generate a combined estimate for the plasma glucose concentration using the interacting multiple model strategy and may comprise a dose estimator which applies the interacting multiple model strategy to determine the amount of medication required.

According to another aspect of the invention, there is provided an apparatus for controlling a substance in human or animal in real time, the apparatus comprising:

-   -   an input to receive an estimate of the said substance     -   an input to receive past control commands     -   an input to receive the desired set point trajectory of the said         substance     -   an interacting multiple model strategy providing optimal         estimate of the said substance     -   an optimal dose estimator relating the control command to the         time evolution of the said substance with the use of         substantially the same interacting multiple model strategy     -   a dispenser, which delivers the amount of medication specified         by the control command.

The interacting multiple model strategy may use a standard or extended Kalman filter.

The substance being controlled is preferably glucose and the medication may be insulin or a combination of insulin and glucagons.

Alternatively, the substance being controlled may be the depth of anaesthesia and the medication may be anaesthesia.

The set point trajectory may be predefined, e.g. obtained from a health monitor which accepts input from a user.

According to another aspect of the invention, there is provided an artificial pancreas for controlling glucose levels in real time comprising:

-   -   a continuous glucose monitor providing an estimate of glucose         level     -   an optimal state estimator based on the interacting multiple         model strategy and adopting a stochastic physiological model of         glucoregulation to provide optimal estimate of glucose level         from data obtained by the continuous glucose monitor     -   a glucose controller utilising a substantially same stochastic         model of glucoregulation as the optimal glucose estimator and a         substantially same interacting multiple model strategy to         determine a control command     -   a dispenser, which delivers the amount of medication specified         by the control command

The artificial pancreas may be a portable device. The dispenser may infuse insulin or a combination of insulin and glucagon. The dispenser may infuse medication intravenously or subcutaneously.

The artificial pancreas may comprise one or more additional glucose monitors providing independent estimates of glucose level. At least one monitor may measure glucose intravenously. At least one monitor may measure glucose subcutaneously.

The artificial pancreas may further comprise a user monitor with an input/output interface to receive inputs from the user and to display status of the artificial pancreas.

The interacting multiple model strategy may use a standard or extended Kalman filter.

The artificial pancreas may receive information about any or all of user triggered insulin boluses, meals, exercise and insulin infusion. This information may be utilised by the physiological model of glucoregulation.

According to another aspect of the invention there is provided a method for estimating retrospectively basal insulin infusion, carbohydrate-to-insulin ratio, and insulin sensitivity comprising the acts of:

-   -   receiving time-series of an estimate of glucose level     -   receiving time-series of administered insulin infusion and         insulin boluses     -   providing the time-series to an interacting multiple model         strategy, which adopts a stochastic physiological model of         glucoregulation to provide optimal estimate basal insulin         infusion, carbohydrate-to-insulin ratio, and insulin sensitivity

According to another aspect of the invention there is provided a decision support system for suggesting in real time insulin bolus comprising:

-   -   a continuous glucose monitor providing an estimate of glucose         level     -   an optimal state estimator based on the interacting multiple         model strategy and adopting a stochastic physiological model of         glucoregulation to provide optimal estimate of glucose level         from data obtained by the continuous glucose monitor     -   a glucose controller utilising a substantially same stochastic         model of glucoregulation as the optimal glucose estimator and a         substantially same interacting multiple model strategy to         determine insulin bolus     -   a user monitor with an input/output interface to receive inputs         from the user and to display the suggested insulin bolus     -   a dispenser, which delivers the amount of medication specified         by the control command

The decision support system may further comprise a dispenser, which based on confirmation by the user delivers the insulin bolus. The insulin bolus may be a prandial insulin bolus or a correction insulin bolus.

The invention further provides processor control code to implement the above-described methods, in particular on a data carrier such as a disk, CD- or DVD-ROM, programmed memory such as read-only memory (Firmware), or on a data carrier such as an optical or electrical signal carrier. Code (and/or data) to implement embodiments of the invention may comprise source, object or executable code in a conventional programming language (interpreted or compiled) such as C, or assembly code, code for setting up or controlling an ASIC (Application Specific Integrated Circuit) or FPGA (Field Programmable Gate Array), or code for a hardware description language such as Verilog (Trade Mark) or VHDL (Very high speed integrated circuit Hardware Description Language). As the skilled person will appreciate such code and/or data may be distributed between a plurality of coupled components in communication with one another.

FIGURES

FIG. 1 a is a schematic drawing showing how the interacting multiple model strategy is used to estimate glucose level;

FIG. 1 b is a schematic drawing which shows how the interacting multiple model strategy is used to estimate glucose level and to determine a dose based on this estimated level;

FIG. 2 is a flowchart showing the steps involved in the use of interacting multiple model strategy for state and covariance estimation;

FIG. 3 is a schematic drawing of an artificial pancreas for controlling glucose levels in a patient using the interacting multiple model strategy

FIG. 1 a shows the key steps in using a multiple model strategy which is used to improve model tracking. The model used is a glucoregulatory model. Overall, N models are defined in a state estimator 20, with each model being a variation of the glucoregulatory model having a different process noise. As explained previously, the process noise represents the random disturbance which is not captured by the other model components and is distinct from the measurement error, which describes the random component of the measurement process. The characteristics of the process noise are usually obtained from retrospective analysis of experimental data. However, the characteristics and specifically the variance of the process noise may be subject to temporal variations. For each model an estimate of the state vector based on glucose measurements and the process noise is calculated in a computationally efficient manner. As an alternative to defining the models to have different process noise, the multiple models defined by the interacting multiple model strategy may differ in certain model constants.

The glucoregulatory may comprise five sub-models, the sub-model of insulin absorption, the sub-model of insulin action, the sub-model of gut absorption, the sub-model of glucose kinetics, and the sub-model of interstitial glucose kinetics. Alternatively, the glucoregulatory model may consist of a sub-set of the models described, e.g. the sub-model of glucose kinetics and the sub-model of interstitial glucose kinetics.

The insulin absorption sub-model is described by a two compartment (two depot) model

$\begin{matrix} {\frac{{i_{1}(t)}}{t} = {{{- \frac{1}{t_{x\; I}}}{i_{1}(t)}} + \frac{u(t)}{60} + {{\delta_{t_{j}}(t)}{v(t)}}}} & (1) \\ {\frac{{i_{2}(t)}}{t} = {- {\frac{1}{t_{x\; I}}\left\lbrack {{i_{2}(t)} - {i_{1}(t)}} \right\rbrack}}} & (2) \\ {{i(t)} = {\frac{1}{t_{x\; I}}\frac{1000}{{MCR}_{I}W}{i_{2}(t)}}} & (3) \end{matrix}$

where i₁(t) and i₂(t) is the amount of insulin in the two subcutaneous insulin depots (U), i(t) is the plasma insulin concentration (mU/l), u(t) denotes insulin infusion (U/h), v(t) denotes insulin boluses given at time t_(j)(U), t_(max,I) is the time-to-peak of insulin absorption (min), MCR_(I) is the metabolic clearance rate of insulin (L/kg/min), and W is subject's weight (kg).

The insulin action sub-model is described as

$\begin{matrix} {\frac{{r_{D}(t)}}{t} = {p_{2D}\left( {{i(t)} - {r_{D}(t)}} \right)}} & (4) \\ {\frac{{r_{E}(t)}}{t} = {p_{2E}\left( {{i(t)} - {r_{E}(t)}} \right)}} & (5) \end{matrix}$

where γ_(D) and γ_(EGP) are the remote insulin actions affecting glucose disposal and endogenous glucose production, respectively, (mU/l), and p_(2,D) and p_(2,EGP) are the fractional disappearance rates associated with the remote insulin actions (/min).

The gut absorption sub-model is described by a two compartment model

$\begin{matrix} {\frac{{a_{1}(t)}}{t} = {{{- \frac{1}{t_{x\; G}}}{a_{1}(t)}} + {v_{G}(t)}}} & (6) \\ {\frac{{a_{2}(t)}}{t} = {- {\frac{1}{t_{x\; G}}\left\lbrack {{a_{2}(t)} - {a_{1}(t)}} \right\rbrack}}} & (7) \\ {{u_{A}(t)} = {\frac{5.551}{{Wt}_{x\; G}}{a_{2}(t)}}} & (8) \end{matrix}$

where a₁(t) and a₂(t) is the amount of glucose in the two absorption compartments (g), u_(A)(t) is the gut absorption rate (mmol/kg/min), v_(G)(t) denotes meal ingestion (g/min), and t_(max,G) is the time-to-peak of the gut absorption (min).

The glucose kinetics sub-model is described as

$\begin{matrix} {\frac{{q_{1}(t)}}{t} = {{{- \left( {{S_{ID}{x_{D}(t)}} + k_{21}} \right)}{q_{1}(t)}} + {k_{12}q_{2}} - F_{01} + {{EGP}(t)} + {{Fu}_{A}(t)} + {u_{S}(t)}}} & (9) \\ {\mspace{79mu} {\frac{{q_{2}(t)}}{t} = {{{+ k_{21}}{q_{1}(t)}} - {k_{12}{q_{2}(t)}}}}} & (10) \\ {\mspace{79mu} {{g_{P}(t)} = \frac{q_{1}(t)}{V_{G}}}} & (11) \end{matrix}$

where q₁(t) and q₂(t) are the masses of glucose in the accessible and non-accessible glucose compartments (mmol/kg), k₂₁ and k₁₂ are the fractional transfer rates (/min), F₀₁ is the non-insulin dependent glucose utilisation (mmol/kg/min), EGP(t) is the endogenous glucose production (mmol/kg/min), S_(I,D) is peripheral insulin sensitivity (/min per mU/l), F is glucose bioavailability (unitless), u_(s)(t) is unexplained glucose influx (mmol/kg/min), g_(P)(t) is plasma glucose concentration, V_(G) is the glucose distribution volume in the accessible compartment (l/kg).

The EGP is obtained as

$\begin{matrix} {{{EGP}(t)} = {{EGP}_{B}{\exp\left( {{- \left( {{r_{E}(t)} - {BIC}} \right)}\frac{\ln (2)}{I_{1/2}}} \right)}}} & (12) \end{matrix}$

where EGP_(B) is the basal endogenous glucose production (mmol/kg/min), BIC is (basal) plasma insulin concentration resulting in plasma glucose concentration of 5.5 mmol/l (mU/l), and I_(1/2) is an increment in the plasma insulin concentration halving the EGP (mU/l).

The change in unexplained glucose influx u_(s)(t) (the process noise) is described by a stochastic differential equation

du _(s)(t)=dw(t)  (13)

where w(t) is 1-dimensional driving Wiener process.

The basal insulin concentration BIC is calculated from the basal insulin requirement (BIR; U/h) as

$\begin{matrix} {{BIC} = {\frac{1000}{60}\frac{BIR}{{MCR}_{I}W}}} & (14) \end{matrix}$

where MCR_(I) is the metabolic clearance rate of insulin (l/kg/min) and W is subject's weight (kg).

The interstitial glucose kinetics sub-model is described as

$\begin{matrix} {\frac{{q_{3}(t)}}{t} = {- {k_{31}\left( {{q_{3}(t)} - {q_{1}(t)}} \right)}}} & (15) \\ {{g_{IG}(t)} = \frac{q_{3}(t)}{V_{G}}} & (16) \end{matrix}$

where q₃(t) is the mass of glucose in the interstitial fluid (mmol/kg), k_(3I) is the fractional transfer rate (/min), and g_(IG)(t) is interstitial glucose concentration.

As shown in FIG. 1 a, a time series of glucose level measurements are inputted from a glucose sensor to the state estimator 20. These measurements may themselves be regarded as estimates for the plasma glucose concentration since they measure interstitial glucose levels. The state estimator 20 applies each model to calculate an estimate for the plasma glucose concentration. These estimates are combined in a modal combiner 22 to generate an optimal glucose estimate.

FIG. 1 b shows a variation of the system of FIG. 1 a in which the model combiner is replaced by a dose calculator 24. The estimates from the state estimator are inputted to and combined in the dose calculator 24 to generate the optimal glucose estimate. A set-point representing the desired level of plasma glucose is also inputted to the dose calculator. The dose calculator 24 inputs the optimal glucose estimate into a control law to determine the dose to the applied so that a patient has the set-point level of plasma glucose. The calculated dose is the output insulin infusion rate

More details of the strategy are shown in FIG. 2. The first step S100 is to define at time k−1, for each model i, a mode state vector x_(i,k−1|k−1), a covariance P_(i,k−1|k−1) and a mixing probability μ_(i,k−1|k−1). The covariance is a measure of the estimated accuracy of the state estimate. The mixing probability is the probability of each mode state vector being the true state vector and is the weighting attached to each state vector estimate when calculating the final state estimate.

The extended state vector x_(k) which uses all the sub-models defined above includes nine states

x _(k) ^(e)=(i _(1,k) ,i _(2,k) ,r _(D,k) ,r _(E,k) ,a _(1,k) ,a _(2,k) ,q _(1,k) ,q _(2,k) ,q _(3,k) ,u _(S,k))^(T)  (17)

where i_(1,k) and i_(2,k) is the amount of insulin in the two subcutaneous insulin depots at time k, γ_(D,k) and γ_(E,k) are the remote insulin actions affecting glucose disposal and endogenous glucose production, a_(1,k) and a_(2,k) are the amount of glucose in the two absorption compartments, q_(1,k), q_(2,k), q_(3,k) represent glucose amounts in the accessible, non-accessible, and interstitial compartments and u_(s,k) is the unexplained glucose influx (process noise).

The function ƒ is used to calculate the predicted state x_(k) from the previous estimate x_(k−1)

x _(k)=ƒ(x _(k−1) ,u _(k) ,w _(k))  (18)

-   -   where w_(k) is a 1-dimensional driving Wiener process (see 13)

z _(k) =h(x _(k) ,v _(k))  (19)

z_(k) is the measurement at time k of the true state x_(k) h is the observation model which maps the true state space into the observed space and v_(k) is the observation noise which is assumed to be zero mean Gaussian white noise with covariance R_(k) (see also eqn 60 below)

The state transition for i_(1,k) (i.e. the transition from time k−1 to time k) is defined by the following expressions

$\begin{matrix} {i_{1,k} = {f_{10} + {f_{11}i_{1,{k - 1}}}}} & (20) \\ {where} & \; \\ {f_{10} = {\frac{u_{k}t_{{x\; I},{k - 1}}}{60}\left( {1 - ^{- \frac{\Delta \; t_{k}}{t_{{x\; I},{k - 1}}}}} \right)}} & (21) \\ {f_{11} = ^{- \frac{\Delta \; t_{k}}{t_{{x\; I},{k - 1}}}}} & (22) \end{matrix}$

The state transition for i_(2,k) is defined by the following expressions

$\begin{matrix} {i_{2,k} = {f_{20} + {f_{21}i_{1,{k - 1}}} + {f_{22}i_{2,{k - 1}}}}} & (23) \\ {where} & \; \\ {f_{20} = {f_{10} - {f_{11}\frac{u_{k}\Delta \; t_{k}}{60}}}} & (24) \\ {f_{21} = {f_{11}\frac{\Delta \; t}{t_{{x\; I},{k - 1}}}}} & (25) \\ {f_{22} = f_{11}} & (26) \end{matrix}$

The state transition for r_(D,k) is defined by the following expressions

$\begin{matrix} {r_{D,k} = {f_{30} + {f_{31}i_{1,{k - 1}}} + {f_{32}i_{2,{k - 1}}} + {f_{33}r_{D,{k - 1}}}}} & (27) \\ {f_{30} = \left\{ \begin{matrix} {\frac{50u_{k}}{3{MCR}_{I}W}\left\lbrack {1 - \frac{f_{33} + {p_{2D}{f_{11}\begin{pmatrix} {{p_{2D}{t_{{x\; I},{k - 1}}\begin{pmatrix} {{\Delta \; t_{k}} +} \\ t_{{x\; I},{k - 1}} \end{pmatrix}}} -} \\ {{\Delta \; t_{k}} - {2t_{{x\; I},{k - 1}}}} \end{pmatrix}}}}{\left( {{p_{2D}t_{{x\; I},{k - 1}}} - 1} \right)^{2}}} \right\rbrack} & {{{if}\mspace{14mu} p_{2D}} \neq \frac{1}{t_{{x\; I},{k - 1}}}} \\ {\frac{50u_{k}}{3{MCR}_{I}W}\left\lbrack {1 - {f_{11}\frac{t_{{x\; I},{k - 1}}^{2} + \left( {{\Delta \; t} + t_{{x\; I},{k - 1}}} \right)^{2}}{2t_{{x\; I},{k - 1}}^{2}}}} \right\rbrack} & {otherwise} \end{matrix} \right.} & (28) \\ {f_{31} = \left\{ \begin{matrix} {\frac{1000p_{2,D}}{{MCR}_{I}{W\left( {{p_{2D}t_{{x\; I},{k - 1}}} - 1} \right)}^{2}}\left( {f_{33} + {f_{11}\frac{\begin{matrix} {{p_{2D}t_{{x\; I},{k - 1}}\Delta \; t_{k}} -} \\ {{\Delta \; t_{k}} - t_{{x\; I},{k - 1}}} \end{matrix}}{t_{{x\; I},{k - 1}}}}} \right)} & {{{if}\mspace{14mu} p_{2D}} \neq \frac{1}{t_{{x\; I},{k - 1}}}} \\ \frac{500\Delta \; t_{k}^{2}f_{11}}{{MCR}_{I}{Wt}_{{x\; I},{k - 1}}^{3}} & {otherwise} \end{matrix} \right.} & (29) \\ {f_{32} = \left\{ \begin{matrix} {\frac{1000p_{2D}}{{MCR}_{I}{W\left( {{p_{2D}t_{{x\; I},{k - 1}}} - 1} \right)}}\left( {f_{11} - f_{33}} \right)} & {{{if}\mspace{14mu} p_{2D}} \neq \frac{1}{t_{{x\; I},{k - 1}}}} \\ \frac{1000\Delta \; t_{k}f_{11}}{{MCR}_{I}{Wt}_{{x\; I},{k - 1}}^{2}} & {otherwise} \end{matrix} \right.} & (30) \\ {f_{33} = ^{{- p_{2D}}\Delta \; t_{k}}} & (31) \end{matrix}$

The state transition for r_(E,k) is defined by the following expressions

$\begin{matrix} {r_{E,k} = {f_{40} + {f_{41}i_{1,{k - 1}}} + {f_{42}i_{2,{k - 1}}} + {f_{44}r_{E,{k - 1}}}}} & (32) \\ {f_{40} = \left\{ \begin{matrix} \begin{matrix} {\frac{50u_{k}}{3{MCR}_{I}W}\left\lbrack {1 - \frac{f_{44} + {p_{{2E},{k - 1}}{f_{11}\begin{pmatrix} {{p_{{2E},{k - 1}}{t_{{x\; I},{k - 1}}\begin{pmatrix} {{\Delta \; t_{k}} +} \\ t_{{x\; I},{k - 1}} \end{pmatrix}}} -} \\ {{\Delta \; t_{k}} - {2t_{{xI},{k - 1}}}} \end{pmatrix}}}}{\left( {{p_{{2E},{k - 1}}t_{{xI},{k - 1}}} - 1} \right)^{2}}} \right\rbrack} \\ {{{{if}\mspace{14mu} p_{{2E},{k - 1}}} \neq \frac{1}{t_{{x\; I},{k - 1}}}}\mspace{419mu}} \end{matrix} \\ {{\frac{50u_{k}}{3{MCR}_{I}W}\left\lbrack {1 - {f_{11}\frac{t_{{x\; I},{k - 1}}^{2} + \left( {{\Delta \; t} + t_{{x\; I},{k - 1}}} \right)^{2}}{2t_{{x\; I},{k - 1}}^{2}}}} \right\rbrack}\mspace{14mu} {otherwise}} \end{matrix} \right.} & (33) \\ {f_{41} = \left\{ \begin{matrix} {\frac{1000p_{{2E},{k - 1}}}{{MCR}_{I}{W\left( {{p_{{2E},{k - 1}}t_{{x\; I},{k - 1}}} - 1} \right)}^{2}}\left( {f_{44} + {f_{11}\frac{\begin{matrix} {{p_{{2E},{k - 1}}t_{{x\; I},{k - 1}}\Delta \; t_{k}} -} \\ {{\Delta \; t_{k}} - t_{{x\; l},{k - 1}}} \end{matrix}}{t_{\max,I}}}} \right)} \\ {{{if}\mspace{14mu} p_{{2E},{k - 1}}} \neq \frac{1}{t_{{x\; I},{k - 1}}}} \\ {\frac{500\Delta \; t_{k}^{2}f_{11}}{{MCR}_{I}{Wt}_{{x\; I},{k - 1}}^{3}}\mspace{14mu} {otherwise}} \end{matrix} \right.} & (34) \\ {f_{42} = \left\{ \begin{matrix} {\frac{1000p_{{2E},{k - 1}}}{{MCR}_{I}{W\left( {{p_{{2E},{k - 1}}t_{{x\; I},{k - 1}}} - 1} \right)}}\left( {^{- \frac{\Delta \; t_{k}}{t_{{xI},{k - 1}}}} - ^{{- p_{{2E},{k - 1}}}\Delta \; t_{k}}} \right)} \\ {{{if}\mspace{14mu} p_{{2E},{k - 1}}} \neq \frac{1}{t_{{x\; I},{k - 1}}}} \\ {\frac{1000\Delta \; t_{k}^{- \frac{\Delta \; t_{k}}{t_{{x\; I},{k - 1}}}}}{{MCR}_{I}{Wt}_{{x\; I},{k - 1}}^{2}}\mspace{14mu} {otherwise}} \end{matrix} \right.} & (35) \\ {f_{44} = ^{{- p_{{2E},{k - 1}}}\Delta \; t_{k}}} & (36) \end{matrix}$

The state transition for a_(1,k) is defined by the following expressions

$\begin{matrix} {{a_{1,k} = {f_{55}a_{1,{k - 1}}}}{where}} & (37) \\ {f_{55} = ^{- \frac{\Delta \; t_{k}}{t_{{x\; G},{k - 1}}}}} & (38) \end{matrix}$

The state transition for a_(2,k) is defined by the following expressions

$\begin{matrix} {{a_{2,k} = {{f_{65}a_{1,{k - 1}}} + {f_{66}a_{2,{k - 1}}}}}{where}} & (39) \\ {f_{65} = {f_{55}\frac{\Delta \; t}{t_{{x\; G},{k - 1}}}}} & (40) \\ {f_{66} = f_{55}} & (41) \end{matrix}$

The state transitions for q_(1,k), q_(2,k), and q _(3,k) are defined by the following expressions

q _(1,k)=ƒ₇₀+ƒ₇₇ q _(1,k−1)+ƒ₇₈ q _(2,k−1)+ƒ₇₉ u _(S,k−1)  (42)

q _(2,k)=ƒ₈₀+ƒ₈₇ q _(1,k−1)+ƒ₈₈ q _(2,k−1)+ƒ₈₉ u _(S,k−1)  (43)

q _(3,k)=ƒ_(12,0)+ƒ_(12,7) q _(1,k−1)+ƒ_(12,8) q _(2,k−1)+ƒ_(12,12) q _(3,k−1)+ƒ_(12,9) u _(S,k−1)  (44)

where coefficients ƒ₇₀, ƒ₇₇, ƒ₇₈, ƒ₇₉, ƒ₈₀, ƒ₈₇, ƒ₈₈, ƒ₈₉, ƒ_(12,0), ƒ_(12,7), ƒ_(12,8), ƒ_(12,9), and ƒ_(12,12) can be obtained algebraically as described in Appendix or by numerical approximations.

The state transitions for u_(S,K) is an identity, i.e.

u_(S,k)=u_(S,k−1)  (45)

Considering a subset state vector x_(k), which includes states with associated uncertainty

x _(k)=(q _(1ƒ,k) ,g _(2ƒ,k) ,u _(S,k) ,F _(k) ,q _(3ƒ,k))^(T)  (46)

where q_(1ƒ,k), q_(2ƒ,k), and q _(3ƒ,k) represent glucose amounts in the accessible, non-accessible, and interstitial compartments excluding the contribution from meals (more correctly the last meal), u_(s,k) is (as before) the unexplained glucose influx (process noise) and F_(k) is the state transition model which is applied to the previous state x_(k−1) (see eqn 55).

The total amount of glucose in the compartments is calculated as

q _(1,k) =q _(1ƒ,k) +q _(1m,k)  (47)

q _(2,k) =q _(2ƒ,k) +q _(2m,k)  (48)

q _(3,k) =q _(3ƒ,k) +q _(3m,k)  (49)

where q_(1m,k), q_(2m,k), and q _(3m,k) represent glucose amounts in the accessible, non-accessible, and interstitial compartments due to the (last) meal.

The glucose masses due to the meal are calculated as

q_(1m,k)=F_(k)ƒ_(7,10)  (50)

q_(2m,k)=F_(k)ƒ_(8,10)  (51)

q_(3m,k)=F_(k)ƒ_(12,10)  (52)

The state transition is obtained as

x _(k) =F _(k) ⁰ +F _(k) x _(k−1) +G _(k) w _(k)  (53)

where

F_(k) ⁰ is the additive transition model which is independent of the previous state x_(k−1) and the process noise

$\begin{matrix} {F_{k}^{0} = \begin{bmatrix} f_{70} \\ f_{80} \\ 0 \\ 0 \\ f_{12,0} \end{bmatrix}} & (54) \end{matrix}$

and

F_(k) is the state transition model which is applied to the previous state x_(k−1)

$\begin{matrix} {F_{k} = \begin{bmatrix} f_{77} & f_{78} & f_{79} & 0 & 0 \\ f_{87} & f_{88} & f_{89} & 0 & 0 \\ 0 & 0 & f_{11,11} & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ f_{12,7} & f_{12,8} & f_{12,9} & 0 & f_{12,12} \end{bmatrix}} & (55) \end{matrix}$

and

G_(k) is the additive transition model which is applied to the process noise w_(k)

$\begin{matrix} {G_{k} = \begin{bmatrix} {g_{1}\Delta \; t_{k}} \\ {g_{2}\Delta \; t_{k}} \\ {\Delta \; t_{k}} \\ 0 \\ {g_{5}\Delta \; t_{k}} \end{bmatrix}} & (56) \end{matrix}$

and the change in the unexplained glucose influx (process noise) w_(k) is normally distributed, with zero mean and standard deviation σ_(w,k)=σ_(w)/√{square root over (Δt_(k))}.

If a glucose measurement is not made in time instance t_(k), the unexplained glucose influx is regressed towards zero with a half-time m_(1/2)

$\begin{matrix} {{f_{11,11} = {\exp \left( {{- \Delta}\; t_{k}\frac{\ln (2)}{m_{1/2}}} \right)}}{otherwise}} & (57) \\ {f_{11,11} = 1} & (58) \end{matrix}$

We find that the covariance Q_(k) of the unexplained glucose influx is

Q _(k)=cov(G _(k) w _(k))=σ_(w,k) ² G _(k) G _(k) ^(T)  (59)

At each time interval, a measurement z_(k) of interstitial glucose concentration is made. This measurement is noisy measurement of the plasma glucose. The measurement noise is normally distributed with mean 0 and standard deviation σ_(Z,k)

z _(k) =Hx _(k) +v _(k)  (60)

where

H is the observation model which maps the true state space into the observed space

H=[000ƒ_(12,10) /V _(G)1/V _(G)]  (61)

and

v_(k) is the observation noise which is assumed to be zero mean Gaussian white noise with covariance R_(k)

R_(k)=E[v_(k)v_(k) ^(T)]=[σ_(Z,k) ²]  (62)

The initial starting position is assumed identical to the first glucose measurement {tilde over (g)}_(IG,0) and an apriori bioavailability {tilde over (F)}

$\begin{matrix} {{\hat{x}}_{0|0} = \begin{bmatrix} {{\overset{\sim}{g}}_{{IG},0}V_{G}} \\ {{\overset{\sim}{g}}_{{IG},0}V_{G}\frac{k_{21}}{k_{12}}} \\ 0 \\ F \\ {{\overset{\sim}{g}}_{{IG},0}V_{G}} \end{bmatrix}} & (63) \end{matrix}$

The uncertainty in glucose concentration and bioavailability is expressed in the initial value of the covariance matrix P_(0|0)

$\begin{matrix} {P_{0|0} = \begin{bmatrix} {\sigma_{Z,0}^{2}V_{G}^{2}} & 0 & 0 & 0 & 0 \\ 0 & {\sigma_{Z,0}^{2}V_{G}^{2}\frac{k_{21}^{2}}{k_{12}^{2}}} & 0 & 0 & 0 \\ 0 & 0 & {4{EGP}_{B}^{2}} & 0 & 0 \\ 0 & 0 & 0 & \sigma_{F}^{2} & 0 \\ 0 & 0 & 0 & 0 & {\sigma_{Z,0}^{2}V_{G}^{2}} \end{bmatrix}} & (64) \end{matrix}$

where σ_(F) ² is the variance of the apriori distribution of bioavailability F.

A multiple model strategy is used to improve model tracking. Overall, N models are defined, which differ in the standard deviation of the unexplained glucose influx w_(k)

σ_(w1,k)=σ_(w1)/√{square root over (Δt_(k))}

σ_(w2,k)=σ_(w2)/√{square root over (Δt_(k))}  (65)

. . .

σ_(wN,k)=σ_(wN)/√{square root over (Δt_(k))}

where σ_(w(i−1))<σ_(wi) without loss of generality.

The Markov transition probability from mode (or model) i to j is defined as p_(ji), i.e. the probability that the system will switch from model i to model j is p_(ji).

At step S102, there is an optional interact step to obtain for model 0, a mode state vector x, a covariance P and a mixing probability μ at time k−1. For i and j, the mixing probability μ_(j|i,k|k) at time k (the weights with which the estimates from the previous cycle k−1 are given to each filter at the beginning of the current cycle k) is defined as

$\begin{matrix} {\mu_{{j{{i,{k - 1}}}k} - 1} = \frac{p_{ji}\mu_{i,{k - 1}}}{{\overset{\_}{c}}_{j}}} & (66) \end{matrix}$

where μ_(i,k) is the mode probability, i.e. probability of each model i being the true model, at time k, and c _(j) is a normalisation factor

$\begin{matrix} {{\overset{\_}{c}}_{j} = {\sum\limits_{i}{p_{ji}\mu_{i,{k - 1}}}}} & (67) \end{matrix}$

The model interaction for mode j proceeds as

$\begin{matrix} {{\hat{x}}_{{0j},{{k - 1}|{k - 1}}} = {\sum\limits_{i}{{\hat{x}}_{j,{{k - 1}|{k - 1}}}\mu_{{j{{i,{k - 1}}}k} - 1}}}} & (68) \\ {P_{{0j},{{k - 1}|{k - 1}}} = {\sum\limits_{i}{\begin{bmatrix} {P_{i,{{k - 1}|{k - 1}}} +} \\ \left( {{\hat{x}}_{i,{{k - 1}|{k - 1}}} - {\hat{x}}_{{0j},{{k - 1}|{k - 1}}}} \right) \\ \left( {{\hat{x}}_{i,{{k - 1}|{k - 1}}} - {\hat{x}}_{{0j},{{k - 1}|{k - 1}}}} \right)^{T} \end{bmatrix}\mu_{{j{{i,{k - 1}}}k} - 1}}}} & (69) \end{matrix}$

At step S104, there is a predict step to obtain for each model j, an estimate for the mode state vector x, covariance P and mixing probability μ at time k based on the observations, up to and including time k−1. In other words, the predict step uses the state estimate from the previous timestep to produce an estimate of the state at the current timestep.

The predict step for mode j consists of

{circumflex over (x)} _(j,k|k−1) =F _(k) ⁰ +F _(k){circumflex over (x)}_(0,j,k−1|k−1)  (70)

P _(j,k|k−1) =F _(k) P _(0,j,k−1|k−1) F _(k) ^(T) +Q _(j,k)  (71)

At step S106, there is an update step which uses measurement information at the current timestep k to refine for each model j, the estimates for the mode state vector x, covariance P and mixing probability μ for the current timestep obtained from step S104. The resulting estimates should be more accurate estimates for the current timestep.

In case of a glucose measurement {tilde over (g)}_(IG,k), for each mode j the update consists of evaluating the measurement residual {tilde over (y)}_(j,k)

$\begin{matrix} {{\overset{\sim}{y}}_{j,k} = {{z_{k} - {H{\hat{x}}_{j,{k|{k - 1}}}}} = \left\lbrack {{\overset{\sim}{g}}_{{IG},k} - \frac{q_{j,{3f},{k - 1}} + {F_{j,{k|{k - 1}}}f_{12,10}}}{V_{G}}} \right\rbrack}} & (72) \end{matrix}$

then evaluating the residual covariance S_(j,k)

$\begin{matrix} \begin{matrix} {S_{j,k} = {{{HP}_{j,{k|{k - 1}}}H^{T}} + R_{k}}} \\ {= \left\lbrack {\frac{\begin{matrix} {p_{j,{k|{k - 1}},55} + {f_{12,10}p_{j,{k|{k - 1}},45}} +} \\ {f_{12,10}\left( {p_{j,{k|{k - 1}},54} + {f_{12,10}p_{j,{k|{k - 1}},44}}} \right)} \end{matrix}}{V_{G}^{2}} + \sigma_{Z,k}^{2}} \right\rbrack} \end{matrix} & (73) \end{matrix}$

The optimal Kalman gain is obtained as

$\begin{matrix} {\begin{matrix} {K_{j,k} = {P_{j,{k|{k - 1}}}H^{T}S_{j,k}^{- 1}}} \\ {= {P_{j,{k|{k - 1}}}{\frac{V_{G}}{d_{j}}\begin{bmatrix} 0 \\ 0 \\ 0 \\ f_{12,10} \\ 1 \end{bmatrix}}}} \\ {= {\frac{V_{G}}{d_{j}}\begin{bmatrix} {p_{j,{k|{k - 1}},15} + {f_{12,10}p_{j,{k|{k - 1}},14}}} \\ {p_{j,{k|{k - 1}},25} + {f_{12,10}p_{j,{k|{k - 1}},24}}} \\ {p_{j,{k|{k - 1}},35} + {f_{12,10}p_{j,{k|{k - 1}},34}}} \\ {p_{j,{k|{k - 1}},45} + {f_{12,10}p_{j,{k|{k - 1}},44}}} \\ {p_{j,{k|{k - 1}},55} + {f_{12,10}p_{j,{k|{k - 1}},54}}} \end{bmatrix}}} \end{matrix}{where}} & (74) \\ {d_{j} = {p_{j,{k|{k - 1}},55} + {f_{12,10}p_{j,{k|{k - 1}},45}} + {f_{12,10}\begin{pmatrix} {p_{j,{k|{k - 1}},54} +} \\ {f_{12,10}p_{j,{k|{k - 1}},44}} \end{pmatrix}} + {\sigma_{Z,k}^{2}V_{G}^{2}}}} & (75) \end{matrix}$

The updated state estimate is obtained as

$\begin{matrix} \begin{matrix} {{\hat{x}}_{j,{kk}} = {{\hat{x}}_{j,{k{k - 1}}} + {K_{j,k}{\overset{\sim}{y}}_{j,k}}}} \\ {= {{\hat{x}}_{j,{k{k - 1}}} +}} \\ {{\frac{\begin{matrix} {{{\overset{\sim}{g}}_{{IG},k}V_{G}} - q_{j,{3f},{k{k - 1}}} -} \\ {F_{j,{k{k - 1}}}f_{12,10}} \end{matrix}}{d_{j}}\begin{bmatrix} {p_{j,{k{k - 1}},15} + {f_{12,10}p_{j,{k{k - 1}},14}}} \\ {p_{j,{k{k - 1}},25} + {f_{12,10}p_{j,{k{k - 1}},24}}} \\ {p_{j,{k{k - 1}},35} + {f_{12,10}p_{j,{k{k - 1}},34}}} \\ {p_{j,{k{k - 1}},45} + {f_{12,10}p_{j,{k{k - 1}},44}}} \\ {p_{j,{k{k - 1}},55} + {f_{12,10}p_{j,{k{k - 1}},54}}} \end{bmatrix}}} \end{matrix} & (76) \end{matrix}$

The updated estimate covariance for the optimal Kalman gain is obtained as

$\begin{matrix} {P_{j,{kk}} = {{\left( {I - {K_{j,k}H}} \right)P_{j,{k{k - 1}}}} =}} & (77) \\ {\begin{bmatrix} 1 & 0 & 0 & {{- f_{12,10}}\frac{\begin{matrix} {p_{j,{k{k - 1}},15} +} \\ {k_{12,10}p_{j,{k{{{k - 1},14}}}}} \end{matrix}}{d_{j}}} & {- \frac{\begin{matrix} {p_{j,{k{k - 1}},15} +} \\ {f_{12,10}p_{j,{k{{{k - 1},14}}}}} \end{matrix}}{d_{j}}} \\ 0 & 1 & 0 & {{- f_{12,10}}\frac{\begin{matrix} {p_{j,{k{k - 1}},25} +} \\ {k_{12,10}p_{j,{k{{{k - 1},24}}}}} \end{matrix}}{d_{j}}} & {- \frac{\begin{matrix} {p_{j,{k{k - 1}},25} +} \\ {f_{12,10}p_{j,{k{{{k - 1},24}}}}} \end{matrix}}{d_{j}}} \\ 0 & 0 & 1 & {{- f_{12,10}}\frac{\begin{matrix} {p_{j,{k{k - 1}},35} +} \\ {k_{12,10}p_{j,{k{k - 1}},34}} \end{matrix}}{d_{j}}} & {- \frac{\begin{matrix} {p_{j,{k{k - 1}},25} +} \\ {f_{12,10}p_{j,{k{k - 1}},24}} \end{matrix}}{d_{j}}} \\ 0 & 0 & 0 & {1 - {f_{12,10}\frac{\begin{matrix} {p_{j,{k{k - 1}},45} +} \\ {k_{12,10}p_{j,{k{k - 1}},44}} \end{matrix}}{d_{j}}}} & {- \frac{\begin{matrix} {p_{j,{k{k - 1}},45} +} \\ {f_{12,10}p_{j,{k{k - 1}},44}} \end{matrix}}{d_{j}}} \\ 0 & 0 & 0 & {{- f_{12,10}}\frac{\begin{matrix} {p_{j,{k{k - 1}},55} +} \\ {k_{12,10}p_{j,{k{k - 1}},54}} \end{matrix}}{d_{j}}} & {1 - \frac{\begin{matrix} {p_{j,{k{k - 1}},55} +} \\ {f_{12,10}p_{j,{k{k - 1}},54}} \end{matrix}}{d_{j}}} \end{bmatrix}P_{j,{k{k - 1}}}} & \; \end{matrix}$

Alternatively, if K_(j,k) is not the optimal Kalman gain, the updated estimate covariance is obtained as

P _(j,k|k)=(I−K _(j,k) H)P _(j,k|k−1)(I−K _(j,k) H)^(T) +K _(j,k) R _(k) K _(j,k) ^(t)  (78)

The likelihood function Λ_(j,k) of mode j is obtained as

$\begin{matrix} {\Lambda_{j,k} = {\frac{V_{G}}{\sqrt{2\pi \; d_{j}}}{\exp \left( \frac{{\overset{\sim}{y}}_{j,k}V_{G}^{2}}{2\; d_{j}} \right)}}} & (79) \end{matrix}$

and the mode probability as

$\begin{matrix} {\mu_{j,k} = {\frac{1}{c}\Lambda_{j,k}{\overset{\_}{c}}_{j}}} & (80) \end{matrix}$

Finally at step S108, there is a combine step whereby the estimated states and covariances for each model are combined to prove overall state and covariance estimates. The overall estimated state vector is obtained from a summation of all estimated state vectors multiplied by their weighting or mixing probability. Similarly, the estimated covariance is derived from a summation of all estimated covariances taking into account the relevant mixing probabilities.

$\begin{matrix} {{\hat{x}}_{kk} = {\sum\limits_{j}^{\;}\; {{\hat{x}}_{j,{kk}}\mu_{j,k}}}} & (81) \\ {P_{{k - 1}{k - 1}} = {\sum\limits_{j}^{\;}{\left\lbrack {P_{j,{kk}} + {\left( {{\hat{x}}_{j,{kk}} - {\hat{x}}_{kk}} \right)\left( {{\hat{x}}_{j,{kk}} - {\hat{x}}_{kk}} \right)^{T}}} \right\rbrack \mu_{j,k}}}} & (82) \end{matrix}$

Referring to FIG. 1 b, the control law used by the dose calculator to determine the correct dose is defined as

$\begin{matrix} {J = {{\sum\limits_{j = N_{1}}^{N_{2}}\; \left\lbrack {{\hat{y}}_{{t + j}t} - w_{t + j}} \right\rbrack^{2}} + {\lambda {\sum\limits_{j = 1}^{N_{2} - d}\; \left\lbrack {\Delta \; \mu_{t + j - 1}} \right\rbrack^{2}}}}} & (83) \end{matrix}$

where ŷ_(t+j|t) is plasma glucose concentration obtained using the combined step defined by Eq. (81) and interstitial glucose measurements taken up to time t, and

Δu _(j) =u _(j) −u _(j−1)  (84)

The extended input vector u⁺ is defined as

u ⁺=(v _(t) u)^(T)  (85)

where v_(i) denotes insulin bolus given at time i and u is insulin infusion with the first element of u, u₁, defining the insulin infusion rate to be delivered.

Thus the control law in matrix notation is

J=J ₁ +J ₂ =∥A(u ⁺ −u _(r) ⁺)+y _(r) −w∥+∥Λ(u−u ⁻¹)∥  (86)

where w is the set point (i.e. desired glucose level), u_(r) is the operating point, y_(r) is the output associated with the operating point, and A represents the model given by Eqs. (1)-(11) linearised around the operating point

$\begin{matrix} {a_{ij} = {\frac{1}{V_{G}}\frac{{dq}_{1,j}}{{du}_{i}^{+}}}} & (87) \end{matrix}$

with the matrix Λ defined as

$\begin{matrix} {\Lambda = \begin{pmatrix} \lambda_{t + 1} & 0 & \cdots & \cdots & 0 \\ 0 & \lambda_{t + 2} & \; & \; & \vdots \\ \vdots & \; & \ddots & \; & \vdots \\ \vdots & \; & \; & \lambda_{t + N - 1} & 0 \\ 0 & \cdots & \cdots & 0 & \lambda_{t + N} \end{pmatrix}} & (88) \end{matrix}$

The two components of the control law J₁ and J₂ and their partial derivatives with respect to u⁺ can be written as

$\begin{matrix} {J_{1} = {{u^{+ T}A^{T}{Au}^{+}{2\left\lbrack {\left( {y_{r} - w} \right)^{T} - {u_{r}^{+ T}A^{T}}} \right\rbrack}{Au}} + {\left\lbrack {{u_{r}^{\_ T}A^{T}} - {2\left( {y_{r} - w} \right)^{T}}} \right\rbrack {Au}_{r}^{+}} - {2w^{T}y_{r}} + {y_{r}^{T}y_{r}} + {w^{T}w}}} & (89) \\ {J_{2} = {\left( {u - u^{- 1}} \right)^{T}\Lambda^{T}{\Lambda \left( {u - u^{- 1}} \right)}}} & (90) \\ {\frac{{dJ}_{1}}{{du}^{+}} = {{2A^{T}{Au}^{+}} + {2{A^{T}\left( {y_{r} - w - {Au}_{r}^{+}} \right)}}}} & (91) \\ {\frac{{dJ}_{2}}{{du}^{+}} = {2\left( {{B^{T}{Bu}^{+}} + b} \right)\mspace{14mu} {with}}} & (92) \\ {B = \begin{pmatrix} 0 & 0 & \cdots & \cdots & \cdots & 0 \\ 0 & {- \lambda_{t + 1}} & 0 & \; & \; & \vdots \\ 0 & \lambda_{t + 2} & {- \lambda_{t + 2}} & 0 & \; & \vdots \\ \vdots & 0 & \; & \ddots & \; & 0 \\ 0 & \; & 0 & \lambda_{t + N - 1} & {- \lambda_{t + N - 1}} & 0 \\ 0 & \cdots & \cdots & 0 & \lambda_{t + N} & {- \lambda_{t + N}} \end{pmatrix}} & (93) \\ {{{B^{T}B} = \begin{pmatrix} 0 & 0 & 0 & \cdots & \cdots & 0 \\ 0 & {\lambda_{t + 1}^{2} + \lambda_{t + 2}^{2}} & {- \lambda_{t + 2}^{2}} & 0 & \; & \vdots \\ 0 & {- \lambda_{t + 2}^{2}} & {\lambda_{t + 2}^{2} + \lambda_{t + 3}^{2}} & {- \lambda_{t + 3}^{2}} & \; & \vdots \\ \vdots & 0 & \; & \ddots & \; & 0 \\ 0 & \; & 0 & {- \lambda_{t + N - 2}^{2}} & {\lambda_{t + N - 2}^{2} + \lambda_{t + N - 1}^{2}} & {- \lambda_{t + N}^{2}} \\ 0 & \cdots & \cdots & 0 & {- \lambda_{t + N - 1}^{2}} & {\lambda_{t + N - 1}^{2} + \lambda_{t + N}^{2}} \end{pmatrix}}{and}} & (94) \\ {b\; = \left( \begin{matrix} 0 & {{- \lambda_{t + 1}^{2}}u_{1}} & 0 & \cdots & \left. 0 \right)^{T} \end{matrix} \right.} & (95) \end{matrix}$

The derivative of J with respect to u⁺ is then obtained as

$\begin{matrix} {{{\frac{dJ}{{du}^{+}} = {{2\left( {{Cu}^{+} + c} \right)} = 0}}{where}}} & (96) \\ {C = {{A^{T}A} + {B^{T}B}}} & (97) \\ {c = {{A^{T}\left( {y_{r} - w - {Au}_{r}^{+}} \right)} + b}} & (98) \end{matrix}$

The solution is found as

u ⁺ =−C ⁻¹ c  (99)

FIG. 3 is a schematic showing apparatus implementing the method of controlling levels of glucose described above. The apparatus comprises at least one continuous glucose monitor 30 which measures the glucose concentration in a patient 32 at regular time intervals which may be every minute, every hour or another user defined interval. The glucose monitor may measure glucose levels intravenously, subcutaneously and/or intradermally. The measured glucose levels provide an initial estimate of the patient's inferred glucose level, e.g. plasma glucose concentration.

The measured glucose levels are input to a processor 34 which calculates a refined estimate of glucose level using the interacting multiple model strategy. The processor 34 uses the refined estimated to calculate a dose to be applied to the patient. The processor 34 is connected to an insulin pump 36 and delivers a control command to the insulin pump 36 in apply the calculated insulin infusion rate to the patient.

The apparatus also comprises an optional user monitor 38 which is connected to the processor 34. The user monitor 38 has an input interface to receive inputs from the user such as meal intake, exercise, etc. This information is input to the processor 34 to use when calculating the refined glucose estimate and dose. The user monitor 38 also receives system status information from the processor and has an output interface to display such information to the patient.

No doubt many effective alternatives will occur to the skilled person. It will be understood that the invention is not limited to the described embodiments and encompasses modifications apparent to those skilled in the art lying within the spirit and scope of the claims appended hereto.

APPENDIX

This appendix describes the closed-form approximation of coefficients ƒ₇₀, ƒ₇₇, ƒ₇₈, ƒ₇₉, ƒ₈₀, ƒ₈₇, ƒ₈₈, ƒ₈₉, ƒ_(12,0), ƒ_(12,7), ƒ_(12,8), ƒ_(12,9), and ƒ_(12,12).

The first element of u, u₁, defines the insulin infusion rate to be delivered. The amount of glucose appearing during the time interval [t_(k−1), t_(k)) can be approximated by a linear function u_(G)(t) (mmol/kg/min) as

$\begin{matrix} {{{u_{G}(t)} = {u_{G,{k - 1}} + {\frac{u_{G,k} - u_{G,{k - 1}}}{\Delta \; t_{k}}t} + u_{S,{k - 1}}}}{where}} & (100) \\ {u_{G,k} = \left\{ \begin{matrix} {{EGP}_{k} - F_{01,k} + u_{A,k}} & {{{if}\mspace{14mu} {bioavailability}\mspace{14mu} {is}\mspace{11mu} {not}\mspace{20mu} {estimated}}\mspace{11mu}} \\ {{EGP}_{k} - F_{{o1},k}} & {{if}\mspace{14mu} {bioavailability}\mspace{14mu} {is}\mspace{14mu} {estimated}} \end{matrix} \right.} & (101) \end{matrix}$

The fractional first order turnover rate k₀₁ from the accessible glucose compartment is obtained as a piecewise constant approximation during the time interval Δt_(k)

$\begin{matrix} {{k_{01}(t)} = {k_{01,k} = {S_{ID}\frac{{x_{D}\left( t_{k - 1} \right)} + {x_{D}\left( t_{k} \right)}}{2}}}} & (102) \end{matrix}$

Denote r_(k) the rate of change in u_(k)

$\begin{matrix} {r_{k} = \frac{u_{G,k} - u_{G,{k - 1}}}{\Delta \; t_{k}}} & (103) \end{matrix}$

Define the auxiliary variables v₁ to v₁₈

$\begin{matrix} {{v_{1} = {k_{01} + k_{12}}}{v_{2} = {\left( {k_{01} - k_{12}} \right)^{2} + {k_{21}\left( {{2v_{1}} + k_{21}} \right)}}}{v_{3} = {v_{1} + k_{21}}}{v_{4} = {k_{01}k_{12}}}{v_{5} = \sqrt{v_{2}}}{v_{6} = {k_{12} - k_{31}}}{v_{7} = {k_{12} + k_{21}}}{v_{8} = {{k_{12}\left( {k_{12} + \left( {k_{21} - k_{31}} \right)} \right)} + {k_{21}k_{31}} - {k_{01}v_{6}}}}{v_{9} = {2{v_{2}\left( {v_{4} - {k_{31}\left( {v_{3} - k_{31}} \right)}} \right)}}}{v_{10} = {{v_{4}\left( {k_{21} - v_{6}} \right)} - {k_{01}{k_{21}\left( {k_{31} - {2k_{21}}} \right)}}}}{v_{11} = {\frac{1}{v_{5}}\left( {k_{01} - k_{12} + k_{21}} \right)}}{v_{12} = ^{{- k_{31}}\Delta}}{v_{13} = ^{{- \frac{1}{2}}\Delta \; {t_{k}{({v_{3} + v_{5}})}}}}{v_{14} = ^{\Delta \; t_{k}v_{5}}}{v_{15} = {v_{13}\left( {v_{14} - 1} \right)}}{v_{16} = {v_{13}\left( {v_{14} + 1} \right)}}{v_{17} = {v_{2}\left( {v_{6} + k_{21}} \right)}}{v_{18} = {v_{5}\left( {{k_{01}\left( {k_{21} - v_{6}} \right)} + {v_{7}\left( {v_{6} + k_{21}} \right)}} \right)}}{Then}} & (104) \\ {f_{77} = \frac{\left( {v_{16} - {v_{15}v_{11}}} \right)}{2}} & (105) \\ {f_{87} = \frac{k_{21}v_{15}}{v_{5}}} & (106) \\ {f_{12,7} = {\frac{k_{31}}{v_{9}}\left( {{v_{13}\left( {{{- v_{6}}v_{2}} + {v_{5}v_{8}} - {v_{14}\left( {{v_{6}v_{2}} + {v_{5}v_{8}}} \right)}} \right)} + {2v_{2}v_{6}v_{12}}} \right)}} & (107) \\ {f_{78} = \frac{v_{15}k_{12}}{v_{5}}} & (108) \\ {f_{88} = \frac{\left( {v_{16} + {v_{15}v_{11}}} \right)}{2}} & (109) \\ {f_{12,8} = {\frac{k_{31}k_{12}}{v_{9}}\left( {{v_{13}\left( {{- v_{2}} + {v_{5}\left( {v_{3} - {2k_{31}}} \right)} - {v_{14}\left( {v_{2} + {v_{5}\left( {v_{3} - {2k_{31}}} \right)}} \right)}} \right)} + {2v_{2}v_{12}}} \right)}} & (110) \\ {f_{79} = {\frac{1}{k_{01}}\left\lbrack {1 + {\frac{v_{13}}{2v_{5}}\left( {v_{7} - k_{01} - v_{5} + {\left( {k_{01} - v_{5} - v_{7}} \right)v_{14}}} \right)}} \right\rbrack}} & (111) \\ {f_{89} = {\frac{k_{21}}{v_{4}}\left\lbrack {1 + {\frac{v_{13}}{2}\left( {\frac{v_{3}}{v_{5}} - 1 - {\left( {\frac{v_{3}}{v_{5}} + 1} \right)v_{14}}} \right)}} \right\rbrack}} & (112) \\ {f_{12,9} = {\frac{1}{k_{01}}\left\lbrack {1 + {\frac{1}{v_{9}}\left( {{k_{31}{v_{13}\left( {v_{17} - v_{18} + {\left( {v_{17} + v_{18}} \right)v_{14}}} \right)}} - {2v_{2}v_{6}v_{12}k_{01}}} \right)}} \right\rbrack}} & (113) \end{matrix}$

The partial derivatives g₁=∂q_(1,k)/∂u_(G,k), g₂=∂q_(2,k)/∂u_(G,k), and g₅=∂q_(3,k)/∂u_(G,k) can be obtained as

$\begin{matrix} {g_{1} = {\frac{1}{\Delta \; t_{k}k_{01}}\left\lbrack {{\Delta \; t_{k}} - {\frac{1}{v_{4}}\left( {v_{7} - {\frac{v_{13\;}}{2v_{5}}\left( {{v_{7}\left( {v_{5} - v_{7}} \right)} + {k_{01}\left( {k_{12} - k_{21}} \right)} + {\left( {{v_{7}\left( {v_{7} + v_{5}} \right)} + {k_{01}\left( {k_{21} - k_{12}} \right)}} \right)v_{14}}} \right)}} \right)}} \right\rbrack}} & (114) \\ {g_{2} = {\frac{k_{21}}{\Delta \; t_{k}v_{4}}\left\lbrack {{\Delta \; t_{k}} - {\frac{1}{v_{4}}\left( {v_{3} - {\frac{v_{13}}{2v_{5}}\left( {\left( {{v_{5}\left( {{2v_{3}} - v_{7} - k_{01}} \right)} + {2v_{4}} - v_{3}^{2}} \right) + {\left( {{v_{3}\left( {v_{3}{\_ v}_{5}} \right)} - {2v_{4}}} \right)v_{14}}} \right)}} \right)}} \right\rbrack}} & (115) \\ {g_{5} = {\frac{1}{\left( {{v_{6}\left( {k_{0} - k_{31}} \right)} - {k_{21}k_{31}}} \right)\Delta \; t_{k}}\left\lbrack {{\frac{v_{9}}{2v_{2}k_{01}}\left( {{\Delta \; t_{k}} - \frac{{v_{7}k_{31}} + v_{4}}{v_{4}k_{31}}} \right)} + \left( {{\frac{k_{31}v_{13}}{2v_{4}v_{5}k_{01}}\left( {{k_{01}{{k_{21}\left( {k_{01} - v_{5}} \right)}++}\left( {v_{7} - v_{5}} \right){v_{7}\left( {v_{6} + k_{21}} \right)}} + v_{10} - {v_{14}\left( {{k_{01}{k_{21}\left( {v_{5} + k_{01}} \right)}} + {\left( {v_{5} + v_{7}} \right){v_{7}\left( {v_{6} + k_{21}} \right)}} + v_{10}} \right)}} \right)} + \frac{v_{12}v_{6}}{k_{31}}} \right)} \right\rbrack}} & (116) \end{matrix}$

These partial derivatives can be used to calculate other coefficients

ƒ₇₀=ƒ₇₉ u _(G,k−1) +g ₁ r _(k)  (117)

ƒ₈₀=ƒ₈₉ u _(G,k−1) +g ₂ r _(k)  (118)

ƒ_(12,0)=ƒ_(12,9) u _(G,k−1) +g ₅ r _(k)  (119)

ƒ_(12,12)=V₁₂  (120)

The coefficients k_(7,10,k), k_(8,10,k), and k _(12,10,k) at time t_(k) are calculated recursively using corresponding coefficients k_(7,10,k−1), k_(8,10,k−1), and k_(12,10,k−1) obtained in the previous time instance t_(k−1)

ƒ_(7,10)=ƒ_(7,10,k−1)ƒ₇₇+ƒ_(8,10,k−1)ƒ₇₈+ƒ₇₉ u _(A,k−1) +g ₁(u _(A,k) −u _(A,k−1))  (121)

ƒ_(8,10)=ƒ_(8,10,k−1)ƒ₈₈+ƒ_(7,10,k−1)ƒ₈₇+ƒ₈₉ u _(A,k−1) +g ₂(u _(A,k) −u _(A,k−1))  (122)

ƒ_(12,10)=ƒ_(12,10,k−1)ƒ_(12,12)+ƒ_(7,10,k−1)ƒ_(12,7)+ƒ_(8,10,k−1)ƒ_(12,8)+ƒ_(12,9) u _(A,k−1) +g ₅(u _(A,k) −u _(A,k−1))  (123) 

1-39. (canceled)
 40. Apparatus for monitoring glucose in human or animal in real time, the apparatus comprising: a sensor providing a time series of measurements of glucose level, said measurements being indicative of an inferred level of said glucose in a part of said human or animal and a processor which is adapted to perform the following steps: calculate a first estimate of said inferred glucose level from said measured glucose level using a first glucoregulatory system model, calculate a second estimate of said inferred glucose level from said measured glucose level using a second glucoregulatory system model with said second system model being a variation of said first system model and predicting a combined estimate of the inferred glucose level based on a combination of the first and second estimates.
 41. Apparatus according to claim 40, wherein the processor is adapted to calculate a combined estimate by weighting each estimate according to an associated mixing probability representing a respective probability of each said model correctly predicting said glucose level.
 42. Apparatus according to claim 41, wherein the processor is further adapted to update said mixing probability responsive to a difference between said predicted glucose level measurement of each respective said model and said glucose level measurement from said sensor.
 43. Apparatus according to claim 40, wherein the processor is a state estimator and is adapted to define a state vector for each model, the state vector comprising a set of variables each having an associated uncertainty, the set of variables including a variable representing an unexplained change in glucose level with each model having a different standard deviation in the unexplained change in glucose level.
 44. Apparatus according to claim 40, further comprising a user monitor to receive inputs from the user and/or to display the status of the apparatus.
 45. Apparatus according to claim 40, wherein the sensor measures the substance intravenously, subcutaneously and/or intradermally.
 46. Apparatus according to claim 40, wherein the glucoregulatory model comprises a sub-model of glucose kinetics in the blood of said human or animal and a sub-model of interstitial glucose kinetics and wherein said inferred substance level comprises a level of said glucose in said blood and said substance level measurements comprises measurements of an interstitial glucose level.
 47. Apparatus according to claim 46, further comprising a real-time alarm which is activated when the combined estimate or the combined estimate of future glucose level is below a preset hypoglycaemia threshold or above a preset hyperglycaemia threshold.
 48. Apparatus for monitoring a substance in human or animal in real time, the apparatus comprising: a sensor providing a time series of measurements of substance level, said measurements being indicative of an inferred level of said substance in a part of said human or animal and a processor which applies an interacting multiple model strategy to a system model to predict a combined estimate of the inferred substance level from the substance level measurements.
 49. Apparatus for monitoring glucose in human or animal in real time, the apparatus comprising: a sensor providing a time series of measurements of glucose level, said measurements being indicative of an inferred level of said glucose in a part of said human or animal and a processor which is adapted to construct at least two state vectors each comprising a set of variables for a respective one of at least two glucose level models, said state vectors representing states of said at least two models, said state vectors also including a variable representing an uncertainty in a change in glucose level with time, each of said variables having an associated probability distribution; predict a value of a said glucose level using said probability distribution and said state vectors; update values of said state vectors responsive to a difference between a predicted glucose level measurement for each said model and a glucose level measurement from said sensor; and update a mixing probability representing a respective probability of each said model correctly predicting said glucose level responsive to a difference between said predicted glucose level measurement of each respective said model and said glucose level measurement from said sensor, and determine a combined predicted glucose level measurement for said human or animal by combining outputs from said glucose level models according to said updated mixing probability.
 50. Apparatus for real time control of glucose in a human or animal, the apparatus comprising: apparatus for real time monitoring as described in claim 40 or claim 49, and a dispenser for delivering a specified amount of medication to a user in response to a command from the processor, wherein the processor is adapted to calculate the specified amount of medication as the amount of medication required to bring the combined predicted glucose level measurement into line with a desired value.
 51. Apparatus for real time control of a substance in a human or animal, the apparatus comprising a sensor providing a time series of measurements of substance level, said measurements being indicative of an inferred level of said substance in a part of said human or animal, a processor which is adapted to calculate an estimate of said inferred level, a dispenser for delivering a specified amount of medication to a user in response to a command from the processor, wherein the processor is adapted to calculate the specified amount of medication as the amount of medication required to bring the estimate of said inferred level in line with a desired value by calculating a first estimate of said specified amount of medication using a first system model, calculate a second estimate of said specified amount of medication using a second system model with said second system model being a variation of said first system model, and calculate a combined estimate of said specified amount of medication based on a combination of the first and second estimates.
 52. Apparatus according to claim 51, wherein the substance is glucose and the dispenser delivers insulin, glucagon or a similar medication or combinations thereof.
 53. Apparatus for controlling glucose in human or animal body, comprising apparatus for real time monitoring as described in claim 40, and a user interface for displaying a suggested insulin bolus to be applied wherein the suggested insulin bolus is calculated by the processor as the amount of medication required to bring the combined estimate into line with a desired glucose value.
 54. Apparatus according to claim 52 or 53, wherein the desired glucose value varies with time to define a trajectory of values.
 55. Apparatus according to claim 53, wherein the processor applies the interacting multiple model strategy to the glucoregulatory model to determine the amount of medication required.
 56. A method of real time glucose monitoring in a living human or animal, the method comprising: inputting a time series of glucose level measurements from a sensor, said glucose level measurements being indicative of a inferred level of said glucose in a part of said human or animal, calculating a first estimate of said inferred glucose level from said measured substance level using a first glucoregulatory system model, calculating a second estimate of said inferred glucose level from said measured substance level using a second glucoregulatory system model with said second system model being a variation of said first system model and predicting a combined estimate of the inferred glucose level based on a combination of the first and second estimates.
 57. A method according to claim 56, comprising applying a Kalman filter.
 58. A method according to claim 57, wherein each estimate is weighted according to a mixing probability representing a respective probability of each said model correctly predicting said glucose level when combining the multiple estimates.
 59. A method according to claim 58, comprising updating said mixing probability responsive to a difference between said predicted glucose level measurement of each respective said model and said glucose level measurement from said sensor.
 60. A method according to claim 58, comprising determining the mixing probability from the model probability.
 61. A method according to claim 56, comprising defining a state vector for each model, the state vector comprising a set of variables each having an associated uncertainty, the set of variables including a variable representing an unexplained change in substance level with each model having a different standard deviation in the unexplained change in substance level.
 62. A method according to claim 56, wherein the glucoregulatory model comprises a sub-model of glucose kinetics in the blood of said human or animal and a sub-model of interstitial glucose kinetics, wherein said inferred substance level comprises a level of said glucose in said blood and said substance level measurements comprises measurements of an interstitial glucose level.
 63. A method according to claim 62, wherein the glucoregulatory model further comprises a sub-model of insulin absorption, a sub-model of insulin action and a sub-model of gut absorption.
 64. A method according to claim 61 comprising measuring the glucose level intravenously, subcutaneously and/or intradermally.
 65. A method according to claim 61, comprising defining a state vector for each model, the state vector comprising a set of variables each having an associated uncertainty, the set of variables including a variable representing an unexplained change in glucose level with each model having a different standard deviation in the unexplained change in glucose level.
 66. A method of real time glucose monitoring in a living human or animal, the method comprising inputting a time series of glucose level measurements from a glucose sensor; constructing at least two state vectors each comprising a set of variables for a respective one of at least two glucose level models, said state vectors representing states of said at least two models, said state vectors also including a variable representing an uncertainty in a change in glucose level with time, each of said variables having an associated probability distribution; predicting a value of a said glucose level using said probability distribution and said state vectors; updating values of said state vectors responsive to a difference between a predicted glucose level measurement for each said model and a glucose level measurement from said sensor; and updating a mixing probability representing a respective probability of each said model correctly predicting said glucose level responsive to a difference between said predicted glucose level measurement of each respective said model and said glucose level measurement from said sensor, and determining a combined predicted glucose level measurement for said human or animal by combining outputs from said glucose level models according to said updated mixing probability.
 67. A method according to claim 66, further comprising using the value of a first of state vectors to modify a second of said state vectors to thereby represent a transition between said models.
 68. A method for real time control of a substance in a human or animal, the method comprising providing a time series of measurements of substance level, said measurements being indicative of an inferred level of said substance in a part of said human or animal, calculating an estimate of said inferred level, calculating a specified amount of medication to be the amount of medication required to bring the estimate of said inferred level in line with a desired value by calculating a first estimate of said specified amount of medication using a first system model, calculate a second estimate of said specified amount of medication using a second system model with said second system model being a variation of said first system model, calculating said specified amount of medication based on a combination of said estimates and delivering said specified amount of medication to a user.
 69. A method according to claim 68, comprising calculating said estimate of said inferred level using real time monitoring comprising: inputting a time series of glucose level measurements from a sensor, said glucose level measurements being indicative of a inferred level of said glucose in a part of said human or animal, calculating a first estimate of said inferred glucose level from said measured substance level using a first glucoregulatory system model, calculating a second estimate of said inferred glucose level from said measured substance level using a second glucoregulatory system model with said second system model being a variation of said first system model and predicting a combined estimate of the inferred glucose level based on a combination of the first and second estimates.
 70. A method for controlling glucose in human or animal body, comprising calculating a combined estimate using real time monitoring as described in claim 56, and displaying a suggested insulin bolus to be applied on a user interface, wherein the suggested insulin bolus is calculated by the processor as the amount of medication required to bring the combined estimate into line with a desired glucose value.
 71. A carrier carrying computer program code to, when running, implementing the method of claim
 56. 